<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div,p {
      width: 200px;
      height: 200px;
      background-color: #bfa;
      
    }
    div {
      opacity: 0;
    }
    p {
      background-color: pink;
      border-radius: 20px 40px;
    }
  </style>
</head>
<body>
  <div></div>
  <p></p>
  <script>
    //1.
    const shape = {
      radius:10,
      diameter() {
        return this.radius * 2;
      },
      perimeter:() => 2 * Math.PI * this.radius //this是window箭头函数的没有自己的this,他的this是它上一层函数的this,如果没有就是window
    };
    console.log(shape.diameter()); // 20
    console.log(shape.perimeter()); // NaN
    //2.
    // class Chameleon {
    //   static colorChange(newColor) {
    //     this.newColor = newColor;
    //   }
    //   constructor({newColor = 'green'} = {}) {
    //     this.newColor = newColor;
    //   }
    // }
    // const freddie = new Chameleon({newColor:'purple'});
    // freddie.colorChange('orange'); // 报错 freddie.colorChange is not a function


    //3.事件传播的三个阶段是什么？
    // 捕获 -> 目标 -> 冒泡

    //6.
    const numbers = [1,2,3];
    numbers[10] = 11;
    console.log(numbers); //  [1, 2, 3, empty × 7, 11]
    //7.
    let newList = [1,2,3].push(4); // newList = 4; 因为push返回值是数组的长度
    // console.log(newList.push(5)); // 报错 newList.push is not a function

    // 8.
    const info = {
      [Symbol('a')]:'b'
    }
    console.log(info);//{Symbol(a): "b"}
    console.log(Object.keys(info));// []

  </script>
</body>
</html>